<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@page import="b1w1nn1ng.crossf1t.business.*"%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>super secret page</title>
</head>
<body>
<%
String username = (String) request.getParameter("j_username");
String password = (String) request.getParameter("j_password");
/* check username for stuff passes (boolean return) */
if (User.verifyLogin(username, password)){
	try {
	response.sendRedirect("user/home.jsp");
	User user = User.getUserByUsername(username);
	session.setAttribute("user", user); 
	}
	catch (Exception e){
		response.sendRedirect("/crossfit/login-error.jsp");
	}
	
} else {
	response.sendRedirect("/crossfit/login-error.jsp");
}
%>

</body>
</html>